restart -f
### Clock 10 Khz
force -freeze sim:/itmer/clockinput 1 0, 0 {0.05ms} -r 0.1ms
force -freeze sim:/itmer/wheelinputa 0 0
force -freeze sim:/itmer/wheelinputb 0 0

run 8ms
# VERY FAST BEGIN SPEED ROTATION 
set x 0
set speed 4  
while {$x<5} {
  set speedBetween [expr $speed/10.0]
  force -freeze sim:/itmer/wheelinputa 1 0
  
  run $speedBetween  ms
  force -freeze sim:/itmer/wheelinputb 1 0
  run $speed ms
  force -freeze sim:/itmer/wheelinputa 0 0
  run $speedBetween ms
  force -freeze sim:/itmer/wheelinputb 0 0
  run $speed ms
  incr speed
  incr x
}

run 1 sec

# Change in mode Timer
force -freeze sim:/itmer/buttoninput  1 0
run 0.3 sec

force -freeze sim:/itmer/buttoninput  0 0

run 3 sec

# Change in mode Pause
force -freeze sim:/itmer/buttoninput  1 0
run 0.3 sec
force -freeze sim:/itmer/buttoninput  0 0
run 3 sec
# Change in mode Timer
force -freeze sim:/itmer/buttoninput  1 0
run 0.3 sec
force -freeze sim:/itmer/buttoninput  0 0
run 15 sec
# Alarm
force -freeze sim:/itmer/buttoninput  1 0
run 1.6 sec
force -freeze sim:/itmer/buttoninput  0 0
run 3 sec

# Inverse rotation
set x 0
set speed 4
while {$x<10} {
  set speedBetween [expr $speed/10.0]
  force -freeze sim:/itmer/wheelinputb 1 0
  run $speedBetween ms
  force -freeze sim:/itmer/wheelinputa 1 0
  run $speed ms
  force -freeze sim:/itmer/wheelinputb 0 0
  run $speedBetween ms
  force -freeze sim:/itmer/wheelinputa 0 0
  run $speed ms
  incr speed
  incr x
}

run 3 sec